﻿@model EagleProject.LinQDataContext.AccidentRecord

@{
    ViewBag.Title = "CreateAccidentRecord";
}

<h2>Create Accident Record</h2>
@using (Html.BeginForm("CreateAccidentRecord", "Admin", FormMethod.Post,
        new { enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Accident Record Data</legend>
        <ol>
            <li>
                <div class="tbl-first">@Html.LabelFor(m => m.Location)</div>
                <div class="tbl-next">@Html.TextBoxFor(m => m.Location)</div>
                <div class="tbl-end">@Html.ValidationMessageFor(m => m.Location)</div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="tbl-first">@Html.LabelFor(m => m.Descriptions)</div>
                <div class="tbl-next">@Html.TextBoxFor(m => m.Descriptions)</div>
                <div class="tbl-end">@Html.ValidationMessageFor(m => m.Descriptions)</div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="tbl-first">@Html.LabelFor(m => m.LevelOfSeverity)</div>
                <div class="tbl-next">@Html.TextBoxFor(m => m.LevelOfSeverity)</div>
                <div class="tbl-end">@Html.ValidationMessageFor(m => m.LevelOfSeverity)</div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="tbl-first"><label for="StateID">State</label></div>
                <div class="tbl-next">@Html.DropDownList("StateID", ViewBag.ListState as SelectList, "All", new { id = "StateID" })</div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="tbl-first">@Html.LabelFor(m => m.LGAID)</div>
                <div class="tbl-next">@Html.DropDownList("LGAID", ViewBag.ListLGAs as SelectList, "Select Local Gov Area", new { id = "LGAID" })</div>
                <div class="tbl-end">@Html.ValidationMessageFor(m => m.LGAID)</div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="tbl-first">@Html.LabelFor(m => m.AccidentType)</div>
                <div class="tbl-next">@Html.TextBoxFor(m => m.AccidentType)</div>
                <div class="tbl-end">@Html.ValidationMessageFor(m => m.AccidentType)</div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="tbl-first"><label for="file">Document File</label></div>
                <div class="tbl-next"><input type="file" name="files" multiple /></div>
                <div class="clear"></div>
            </li>
        </ol>
        <input type="submit" name="Submit" id="Submit" value="Submit" class="btn" />
    </fieldset>
    
    @section Scripts {
        @Scripts.Render("~/bundles/jqueryval")
    }

    <script src="@Url.Content("~/Scripts/jquery-1.7.1.js")"></script>
    <script src="@Url.Content("~/DataScript/webApi.js")"></script>
    <script>
    @*function registerUpdate(thisid, otherid, emptyString, apiUrl) {*@
        apiUrl = '@Url.Content("~/api/lga/")';
        registerUpdate('StateID', 'LGAID', 'Select Local Gov Area', apiUrl);
    </script>
}